def spam(num):
    try:
        return 2 / num
    except ZeroDivisionError:
        return 0


print(spam(21))
print(spam(0))
